//
//  ManyLabelCell.m
//  cell
//
//  Created by Sich on 16/11/28.
//  Copyright © 2016年 sicuihuan. All rights reserved.
//

#import "ManyLabelCell.h"
#import "Masonry.h"

@implementation ManyLabelCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.contentView.backgroundColor = [UIColor yellowColor];
        [self createUI];
    }
    return self;
}

- (void)createUI{
    //用masnory适配两个控件
    
    UILabel *label = [[UILabel alloc] init];
    label.text = @"我用-masnory我用-masnory我用-masnory我用-masnory我用-masnory我用-masnory我用-masnory我用-masnory我用-masnory我用-masnory我用-masnory";
    label.textAlignment = NSTextAlignmentCenter;
    label.backgroundColor = [UIColor redColor];
    label.font = [UIFont systemFontOfSize:19];
    label.numberOfLines = 0;
    [self.contentView addSubview:label];

    UIImageView *image = [[UIImageView alloc] init];
    image.backgroundColor = [UIColor blueColor];
    image.alpha = 0.4;
    [self.contentView addSubview:image];
    
    //不用固定底部
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.contentView.mas_top).offset(10);
        make.left.mas_equalTo(self.contentView.mas_left).offset(10);
        make.right.mas_equalTo(self.contentView.mas_right).offset(-10);
    }];
    
    [image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(label.mas_bottom).offset(10);
        make.left.mas_equalTo(self.contentView.mas_left).offset(10);
        make.right.mas_equalTo(self.contentView.mas_right).offset(-10);
        make.bottom.mas_equalTo(self.contentView.mas_bottom).offset(-10);
        make.height.equalTo(@40);
    }];
    
    
    
    
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
